from datetime import datetime

from flask import Flask, Blueprint, render_template, session, redirect, url_for, request, Response, jsonify
# 这里注意要导入models中的models，而不是extends中的models
from sqlalchemy import Time

from App.models import *

electricitypayblue = Blueprint('electricitypayblue', __name__)


@electricitypayblue.route('/electpayBySid', methods=['GET', 'POST'])
def getElecPay():
    sid = request.values.get('sid')
    result = getElectricitypayByDid(sid)
    result_dict = [dict(model) for model in result]
    return jsonify(result_dict)
